﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Site.Models.ProfileAdmin>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Index</h2>

<p>
    <%: Html.ActionLink("Create New", "Create") %>
</p>
<table>
    <tr>
       <th>
            Classement
        </th>
        <th>
            Pseudo
        </th>
         <th>
            Nb Victoire
        </th>
        <th>
            Nb défaites
        </th>

        <th>
            Bloqué
        </th>
        <th>
            Date de dérniere connexion
        </th>
        <th>
            Statut
        </th>
        <th></th>
    </tr>

<% foreach (var item in Model)  { %>
    <tr>
         <td>
            <%: Html.DisplayFor(modelItem => item.stats.STAT_RANK) %>
        </td>
                 <td>
            <%: Html.DisplayFor(modelItem => item.users.UserName) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.stats.STAT_WONGAMES) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.stats.STAT_LOSTGAMES)%>
        </td>
                <td>
            <%: Html.DisplayFor(modelItem => item.memberShip.IsLockedOut)%>
        </td>
        
                <td>
            <%: Html.DisplayFor(modelItem => item.memberShip.LastLoginDate)%>
        </td>
                        <td>
            <%: Html.DisplayFor(modelItem => item.roles.RoleName)%>
        </td>
        <td>
            <%: Html.ActionLink("Edit", "Edit", new { id = item.users.UserId })%> |
            <%: Html.ActionLink("Details", "Details", new {  id=item.users.UserId }) %> |
            <% if (item.memberShip.IsLockedOut == true )  { %>  
            <%: Html.ActionLink("Unlock", "UnLock", new { id = item.users.UserId }) %>
            <% }  else   %>
            <%:  Html.ActionLink("Delete", "Delete", new { id = item.users.UserId }) %>
            
        </td>
    </tr>
<% } %>

</table>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="alerts" runat="server">
</asp:Content>
